package com.princess.demok.mvvm.repository

import androidx.lifecycle.MutableLiveData
import com.princess.baselib.utils.SharedPreferencesUtils
import com.princess.demok.base.repository.ApiRepository
import com.princess.demok.common.State

/**
 * @author: xha
 * @date: 2021/6/2 17:17
 * @Description:
 */
class HomeRepository(var loadState: MutableLiveData<State>) : ApiRepository() {

    fun setTheme(theme: Int, mThemIntData: MutableLiveData<Int>) {
        if (theme == 0) {
            SharedPreferencesUtils.putShared("theme", 1)
            mThemIntData.postValue(1)
        } else {
            SharedPreferencesUtils.putShared("theme", 0)
            mThemIntData.postValue(0)
        }
    }
}